<%var body = {%>
<div style="width: 100%; height: 750px">
	<#table id="user" objectCode="eova_user_code" />
</div>

<script type="text/javascript">
// 确认按钮回调
var btnSaveCallback = function($dialog, ID, $$) {
	var row = getSelectRow('user');
	
	var action = $.str.format('/eova/admin/doSu/{0}-{1}-{2}', row.id, row.rid_val,  row.org_id_val || 0);
	var user = $.str.format('{1}:{2}[{0}]', row.id, row.rid, row.name);
	
	$.ajax({
		async: false,
		type: 'POST',
		url: action,
		data: {
			name : row.name
		},
		dataType: "json",
		error: function(){
			$$.error("500:服务端异常,请查看日志,排查异常");
		},
		success: function (result) {
			if (result.success) {
				$$.msg('用户切换为:' + user);
				$$('#SU').text('SU：'+ user);
				$.dialogClose(parent.layer, window);
			} else {
				$$.error(result.msg);
			}
		}
	});
};
</script>

<%};include("/eova/layout/form.html",{'title' : '超级用户切换', 'layoutContent' : body, 'isEditor' : false}){}%>